home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / pages2.arc / DEMO.PRG < prev    next >
Text File  |  1986-11-25  |  1KB  |  46 lines

  1. * demo.prg
  2. * demo driver for PAGES.PRG
  3. * AS 11/17/86
  4.  
  5. set status off
  6. set talk off
  7. close databases
  8. close procedure
  9. set procedure to pages
  10.  
  11. if .not. file("line.dbf")
  12.    @3,0 say "PAGES needs LINE.DBF"
  13.    return
  14. endif
  15. if .not. file("curson.bin") .or. .not. file("cursoff.bin")
  16.    @3,0 say "PAGES needs CURSON.BIN and CURSOFF.BIN to run"
  17.    return
  18. endif
  19.  
  20. @0,0 say "PAGES demo: A. Schulman, Nov. 1986"
  21.  
  22. public thisfile
  23. thisfile = "pages.dat"
  24.  
  25. do while len(trim(thisfile)) > 0
  26.    do SHOW_REV with thisfile, 1, 0
  27.    do PAGES with thisfile, 1, 19, 3, 1, 2, .T.
  28. enddo
  29.  
  30. * if pages doesn't want itself called again, it sets thisfile to "";
  31. * otherwise it returns a good filename
  32. * this makes recursion (pages calling itself) unnecessary, but requires
  33. * that both calling program and pages know about variable thisfile.
  34. * remember that for pages.src, thisfile is actually parameter FILENAME!
  35.  
  36. if file("command.com")   && will look on path, not just current dir
  37.    @row()-2,0
  38.    run dir > temp.txt
  39.    @0,0 say "A smaller PAGES window, this time looking at your directory,"
  40.    @1,0 say "just to show that any text can be input for PAGES"
  41.    @17,0 clear
  42.    do PAGES with 'temp.txt', 2, 14, 3, 1, 2, .F.
  43. endif
  44.  
  45. @row(),0 say "Demo completed: You might need to reopen your old procedure file"
  46.